<template>
	<textarea ref="testRef" v-model="text"></textarea>
</template>
<script setup lang="ts">
import { useResizeObserver } from "@vueuse/core";
import { ref } from "vue";
const testRef = ref();
const text = ref<string>("");
useResizeObserver(testRef, ([entry]: any[]) => {
	const { height, width } = entry.contentRect;
	text.value = `宽:${width};高:${height}`;
});
</script>